#include <iostream>

using namespace std;

int main()
{
	int n = 0;
	cin >> n;
	
	int a = 0, b = 0;
	if (n % 2 == 0) a = 1;
	if (n > 4 && n <= 12) b = 1;

	cout << (a && b) << " ";
	cout << (a || b) << " ";
	cout << (a && !b || !a && b) << " ";
	cout << (!a && !b) << " ";
}